/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class DoctorDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression idDoctor;
	public final StringExpression DNI;
	public final StringExpression especialidad;
	public final StringExpression name;
	public final StringExpression lastName;
	
	public DoctorDetachedCriteria() {
		super(orm.Doctor.class, orm.DoctorCriteria.class);
		idDoctor = new IntegerExpression("idDoctor", this.getDetachedCriteria());
		DNI = new StringExpression("DNI", this.getDetachedCriteria());
		especialidad = new StringExpression("especialidad", this.getDetachedCriteria());
		name = new StringExpression("name", this.getDetachedCriteria());
		lastName = new StringExpression("lastName", this.getDetachedCriteria());
	}
	
	public DoctorDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.DoctorCriteria.class);
		idDoctor = new IntegerExpression("idDoctor", this.getDetachedCriteria());
		DNI = new StringExpression("DNI", this.getDetachedCriteria());
		especialidad = new StringExpression("especialidad", this.getDetachedCriteria());
		name = new StringExpression("name", this.getDetachedCriteria());
		lastName = new StringExpression("lastName", this.getDetachedCriteria());
	}
	
	public BabyMonitorDetachedCriteria createBabyMonitorCriteria() {
		return new BabyMonitorDetachedCriteria(createCriteria("babyMonitor"));
	}
	
	public Doctor uniqueDoctor(PersistentSession session) {
		return (Doctor) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Doctor[] listDoctor(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Doctor[]) list.toArray(new Doctor[list.size()]);
	}
}

